Part Number Hot Search : 
SNC21060 68HC7 CTCDRH73 SF205 2128561 35003 1001A CFB949AR
Product Description
Full Text Search
 

To Download AN3236 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  may 2014 docid17613 rev 3 1/15 AN3236 application note guidelines to increase the number of touch sensing touchkeys introduction the touch sensing libraries allow management of the following number of channels depending on the targeted device series : ? up to 24 channels when using devices from the stm32f0, stm32f3 and stm32l0 series. ? up to 34 channels when using devices from the stm32l1 series. ? up to 6 channels when using devices from the stm8l101 lines. ? up to 20 channels when using devices from the stm8l151/152 and the stm8l162 lines. ? up to 24 channels when using devices from the stm8s and stm8af series. the guidelines detailed into this document aim to help designers to overcome channel number limitation. they describe tips and tricks to increase the number of touchkeys and/or to create a touchkey matrix by keeping the same targetted device. table 1. applicable products type applicable products microcontrollers stm32f0 series, stm32f3 series, stm32l0 series, stm32l1 series, stm8l series, stm8s series, stm8af series. www.st.com
contents AN3236 2/15 docid17613 rev 3 contents 1 adding an extra touchkey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.1 basic hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2 software implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2 combined implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 touchkey matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.1 matrix hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2 software implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.3 limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4 maximizing the number of touc hkeys . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5 working around the limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.1 touchkeys set definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.2 detection exclusion system (d xs) usage . . . . . . . . . . . . . . . . . . . . . . . . . 13 6 conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 7 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
docid17613 rev 3 3/15 AN3236 list of tables 3 list of tables table 1. applicable products . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 table 2. decoding example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 table 3. document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
list of figures AN3236 4/15 docid17613 rev 3 list of figures figure 1. basic hardware implementation example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 figure 2. combined impl ementation example for mu lti-touch capability . . . . . . . . . . . . . . . . . . . . . . . 7 figure 3. example of an implementation for six touchkeys with only three channels . . . . . . . . . . . . . 8 figure 4. matrix hardware implementation ex ample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 figure 5. decodable multi-touch example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 6. ghost effect example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 figure 7. touchkey matrix with a single electrode on each channel . . . . . . . . . . . . . . . . . . . . . . . . . 12
docid17613 rev 3 5/15 AN3236 adding an extra touchkey 14 1 adding an extra touchkey this section explains how to add an extra touc hkey to a pair of single electrodes for an application. 1.1 basic hardware implementation as shown in figure 1: basic hardware implementation example , a standard touchkey is made of a single ended electrode. two single electrodes can generat e a third touchkey by interlacing teeth coming from each electrode. figure 1. basic hardware implementation example #( #( 4ouchkey ai 4ouchkey 4ouchkey
adding an extra touchkey AN3236 6/15 docid17613 rev 3 1.2 software implementation the touch sensing library manages the channels acquisition as if there are only two single electrodes. the application must thus decode the result of the acquisition as shown in table 2: decoding example . 1.3 limitation the drawback of this hardware and software implementation is that there is no way to discriminate a touch on both touchkey 1 and to uchkey 2 from a single touch on touchkey 3 as implemented in figure 1 . so, this solution suits applications where only one touchkey can be detected at once or, if a few touchkeys are valid at the same time, where the touchkeys do not share an electrode. table 2. decoding example touchkeys channel 1 state channel 2 state no touch idle idle touchkey 1 touched detect idle touchkey 2 touched idle detect touchkey 3 touched detect detect
docid17613 rev 3 7/15 AN3236 combined implementation 14 2 combined implementation combined implementation (see figure 2 ) allows any touchkey fr om set 1, 2 or 3 to be touched simultaneously but, if two touchkeys from within the same set are touched concurrently, an incorrect touchkey is detected. for instance, touchkeys 1, 6 and 8 can be touched by the user at the same time and t he application decodes them correctly but, if touchkeys 2 and 3 are touched simultaneously only touchkey 3 is reported. likewise, if touchkeys 4 and 5 are touched concurrent ly, touchkey 6 is incorrectly reported. figure 2. combined implementation example for multi-touch capability 1. a set consists of three touc hkeys acquired through two channels. #( #( #( #( #( #( 4ouchkeys 4ouchkeys 4ouchkeys        3et 3et 3et ai
combined implementation AN3236 8/15 docid17613 rev 3 a channel can be connected to several double -ended electrodes which allows the number of: ? touchkeys to be doubled (very suitable for products with few channels) ? gpios used for the touch sensin g acquisition to be reduced. figure 3 gives an example of an implementation where six touchkeys are generated with only three channels. figure 3. example of an implementation for six touchkeys with only three channels 4ouchkey 4ouchkey 4ouchkey ai 4ouchkey 4ouchkey 4ouchkey #( #( #(
docid17613 rev 3 9/15 AN3236 touchkey matrix 14 3 touchkey matrix in some applications, adding one touchkey by electrode pairs is not enough and building an electrode network to get a touchkey matrix is more efficient. 3.1 matrix hardware implementation the double-ended electrode solution can be ex tended to create an electrode network as shown in figure 4: matrix hardware implementation example figure 4. matrix hardware implementation example in this implementation example, seven channels provide a touchkey matrix of12 touchkeys. each touchkey is generated by interlacing a channel row with a channel column. for example, touchkey 1 is generated by interlacing ch1 with ch4. it is recommended to have homogenous sized touchkeys so that each to uchkey has the same sensitivity. this simplifies the threshold setup and acquisition can be achieved using the same sampling capacitor value. #h ai #h #h #h #h #h #h 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey
touchkey matrix AN3236 10/15 docid17613 rev 3 3.2 software implementation channel acquisition is managed by the touch sensing firmware library in the same way as for single electrodes. a decoding step must be also performed at application level depending on the combination of detected channels. a touch on touchkey 1 triggers a detection on two channels, ch1 and ch4 (see figure 4: matrix hardware implementation example ). the decoding table mirrors the matrix shown in figure 4 . a touchkey is activated when the two channels it is connected to are in detection state. 3.3 limitation for such a touchkey matrix, one or several to uchkeys can be touched si multaneously on the same row or the same column. as shown in figure 5 , touchkey 1, 4, 7, and 10 are touched simultaneously and can be decoded without ambiguity. figure 5. decodable multi-touch example #h ai #h #h #h #h 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkeyhxvpressed #h #h 4ouchkey
docid17613 rev 3 11/15 AN3236 touchkey matrix 14 however, when two touchkeys are touched on different rows or columns, four channels are detected and it is difficult to discriminate a true touch from a false one. this phenomenon is known as the ?ghost? effect. in figure 6 , touchkey 1 and touchkey 5 are touched but, channels 1, 2, 4 and 5 are detected. from the application, it is impossible to determine which of the four touchkeys are touched. figure 6. ghost effect example #h ai #h #h #h #h 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkeyhxvpressed #h #h 4ouchkey 4ouchkeyhyvghostkey
maximizing the number of touchkeys AN3236 12/15 docid17613 rev 3 4 maximizing the number of touchkeys the user can combine the touchkey matrix with single electrode touchkeys to maximize the number of possible touchkeys. this gives a pure single touch interface. in this configuration, single electrodes are added on each row and column of the touchkey matrix as shown in figure 7 . there are two decoding cases: ? if one channel is detected, the connecte d single electrode touchkey is touched ? if two channels are detected, the touchkey corresponding to the in tersection of the two channels is touched. in the case of multi-touches, it is impossibl e to discriminate which touchkeys are touched. this solution is only adapted for applications where the user touches one key at a time. figure 7. touchkey matrix with a single electrode on each channel ai #h #h #h #h 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey #h #h #h 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey 4ouchkey
docid17613 rev 3 13/15 AN3236 working around the limitations 14 5 working around the limitations the limitations can be reduced through careful management of the touchkeys and touchkey matrices. 5.1 touchkeys set definition for extra touchkeys and touchkey matrices, it is important to define sets of touchkeys in which the touchkeys cannot be touched at t he same time. this al lows multi-touching capability across sets. sets can be catagorized as follows: ? a touchkey matrix and a few independent to uchkeys which allow simultaneous touches on any of the independent touchkeys plus one touch on the touchkey matrix. ? two touchkey matrices which allow simulta neous touches on each touchkey matrix. 5.2 detection exclusio n system (dxs) usage for a touchkey matrix (without single electrode touchkeys), dxs allows only the first detected touch inside a group to be reported. by defining a dxs group with channel rows and another group with channel columns, only one touchkey can be activated at a time. for application managing only single touch, this simplifies the processing at application level. 6 conclusion the described guidelines allow the touchkey capabilities of stmicroelectronics microcontrollers to be improved without modifying the touch sensing firmware library. in application software, the processing must pr ovide a simple decoding step to determine which touchkey is touched when a pair of channels is activated.
revision history AN3236 14/15 docid17613 rev 3 7 revision history table 3. document revision history date revision changes 18-jun-2010 1 initial release. 18-nov-2013 2 added support for stm32f0, stm32f3, stm32l1, stm8af series and stm8l162 lines. updated section 1: adding an extra touchkey . updated section 3: touchkey matrix . updated section 4: maximizing the number of touchkeys . updated section 5: working around the limitations . removed paragraph ?maximum touchkey matrix size by product?. updated section 6: conclusion . 28-may-2014 3 added support for stm32l0 series.
docid17613 rev 3 15/15 AN3236 15 please read carefully: information in this document is provided solely in connection with st products. stmicroelectronics nv and its subsidiaries (?st ?) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described he rein at any time, without notice. all st products are sold pursuant to st?s terms and conditions of sale. purchasers are solely responsible for the choice, selection and use of the st products and services described herein, and st as sumes no liability whatsoever relating to the choice, selection or use of the st products and services described herein. no license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. i f any part of this document refers to any third party products or services it shall not be deemed a license grant by st for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoev er of such third party products or services or any intellectual property contained therein. unless otherwise set forth in st?s terms and conditions of sale st disclaims any express or implied warranty with respect to the use and/or sale of st products including without limitation implied warranties of merchantability, fitness for a parti cular purpose (and their equivalents under the laws of any jurisdiction), or infringement of any patent, copyright or other intellectual property right. st products are not designed or authorized for use in: (a) safety critical applications such as life supporting, active implanted devices or systems wi th product functional safety requirements; (b) aeronautic applications; (c) automotive applications or environments, and/or (d) aerospace applications or environments. where st products are not designed for such use, the purchaser shall use products at purchaser?s sole risk, even if st has been informed in writing of such usage, unless a product is expressly designated by st as being intended for ?automotive, automotive safety or medical? industry domains according to st product design specifications. products formally escc, qml or jan qualified are deemed suitable for use in aerospace by the corresponding governmental agency. resale of st products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by st for the st product or service described herein and shall not create or extend in any manner whatsoev er, any liability of st. st and the st logo are trademarks or registered trademarks of st in various countries. information in this document supersedes and replaces all information previously supplied. the st logo is a registered trademark of stmicroelectronics. all other names are the property of their respective owners. ? 2014 stmicroelectronics - all rights reserved stmicroelectronics group of companies australia - belgium - brazil - canada - china - czech republic - finland - france - germany - hong kong - india - israel - ital y - japan - malaysia - malta - morocco - philippines - singapore - spain - sweden - switzerland - united kingdom - united states of america www.st.com


▲Up To Search▲   

 
Price & Availability of AN3236

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X